

import axios from 'axios'
import Qs from 'qs'

// const baseUrl = 'http://e2.ruiwuke.com/'  

export const baseUrl = '/api'
// export const baseUrl = ''  //测试环境 生产环境/

//http://e2.ruiwuke.com/ecadmin 测试地址

// 登录
export const login = params => { return axios.post(`${baseUrl}/login/adminToken?${params}`) }
// 注销
export const logout = params => { return axios.post('/guanglian/sys/logout', params) }
// 上传文件
export const uploadErpFile = params => { return axios.post(`${baseUrl}/erp/excel2goodsCode`, params) }
// 上传金蝶文件
export const uploadKDErpFile = params => { return axios.post(`${baseUrl}/erp/excel2goodsCodeKD`, params) }
// 上传金蝶文件
export const uploadGYErpFile = params => { return axios.post(`${baseUrl}/erp/excel2goodsCodeGY`, params) }
// 上传金蝶文件
export const uploadSCSErpFile = params => { return axios.post(`${baseUrl}/erp/excel2goodsCodeGYScs`, params) }
// 自助签约开户
export const addSelfSignAccount = params => { return axios.post(`${baseUrl}/erp/AutoRegAdd`, params) }
// 自助签约
export const selfSign = params => { return axios.get(`${baseUrl}/erp/applyAutoReg?${params}`) }
// 自助签约列表
export const selfSignList = params => { return axios.get(`${baseUrl}/erp/autoRegList?${params}`) }
// 查询自助签约
export const updateSign = params => { return axios.get(`${baseUrl}/erp/viewAutoReg?${params}`) }
// 支付日志
export const payLogList = params => { return axios.get(`${baseUrl}/erp/payLogList?${params}`) }
// 金蝶和用友日志
export const getLogList = params => { return axios.get(`${baseUrl}/erp/getLogList?${params}`) }
// 银联商户信息查询
export const checkFenMer = params => { return axios.post(`${baseUrl}/erp/fenMerNo`, params) }
// 出款操作记录查询
export const checkFen = params => { return axios.post(`${baseUrl}/erp/fenQuery`, params) }
// 三方订单异常日志
export const getCustomerLogList = params => { return axios.get(`${baseUrl}/erp/customerLogList?${params}`) }
// 金蝶日志
export const getKDlogList = params => { return axios.get(`${baseUrl}/erp/getOrderListOfKD?${params}`) }
// 用友日志
export const getYYlogList = params => { return axios.get(`${baseUrl}/erp/getOrderListOfTplus?${params}`) }
// 数据中心列表
export const getAllDataCenter = params => { return axios.get(`${baseUrl}/erp/getAllDataCenter`) }
// 金蝶重传+拦截
export const changeKDlogList = params => { return axios.get(`${baseUrl}/kd/updateHasDealManually?${params}`) }
// 金蝶推送平台重传+拦截
export const changeKDSCSlogList = params => { return axios.get(`${baseUrl}/kd/updateScsHasDealManually?${params}`) }
// 用友重传+拦截
export const changeYYlogList = params => { return axios.get(`${baseUrl}/tplus/updateHasDealManually?${params}`) }
// app版本列表
export const getAppVersion = params => { return axios.get(`${baseUrl}/erp/getAllAppVersion`) }
// app版本控制
export const updateAppVersion = params => { return axios.post(`${baseUrl}/erp/updateAppVersion`, params) }
// 金蝶对照列表
export const getKdGoodsCodeList = params => { return axios.get(`${baseUrl}/erp/getKdGoodsCodeList?${params}`) }
// 新增或编辑金蝶对照表
export const addOrUpdateKdGoodsCode = params => { return axios.post(`${baseUrl}/erp/addOrUpdateKdGoodsCode`, params) }
// 删除金蝶对照表
export const deleteKdGoodsCode = params => { return axios.get(`${baseUrl}/erp/deleteKdGoodsCode?${params}`) }
// 金蝶对照表置为有效
export const usefulKdGoodsCode = params => { return axios.get(`${baseUrl}/erp/usefulKdGoodsCode?${params}`) }
// 用友对照列表
export const getTplusGoodsCodeList = params => { return axios.get(`${baseUrl}/erp/getTplusGoodsCodeList?${params}`) }
// 新增或编辑用友对照表
export const addOrUpdateTplusGoodsCode = params => { return axios.post(`${baseUrl}/erp/addOrUpdateTplusGoodsCode`, params) }
// 删除用友对照表
export const deleteTplusGoodsCode = params => { return axios.get(`${baseUrl}/erp/deleteTplusGoodsCode?${params}`) }
// 用友对照表置为有效
export const usefulTplusGoodsCode = params => { return axios.get(`${baseUrl}/erp/usefulTplusGoodsCode?${params}`) }
// 管易对照列表
export const getGyGoodsCodeList = params => { return axios.get(`${baseUrl}/erp/getGyGoodsCodeList?${params}`) }
// 新增或编辑管易对照表
export const addOrUpdateGyGoodsCode = params => { return axios.post(`${baseUrl}/erp/addOrUpdateGyGoodsCode`, params) }
// 删除管易对照表
export const deleteGyGoodsCode = params => { return axios.get(`${baseUrl}/erp/deleteGyGoodsCode?${params}`) }
// 置为有效管易对照表
export const usefulGyGoodsCode = params => { return axios.get(`${baseUrl}/erp/usefulGyGoodsCode?${params}`) }
// 导出管易对照表
export const exportGY = params => { return axios.post(`${baseUrl}/erp/exportGyGoodsCodeExcel`, params) }
// 导出飞迩对照表
export const exportSCS = params => { return axios.post(`${baseUrl}/erp/exportGyScsGoodsCodeExcel`, params) }
// 飞迩对照列表
export const getSCSGoodsCodeList = params => { return axios.get(`${baseUrl}/erp/getGyScsGoodsCodeList?${params}`) }
// 新增或编辑飞迩对照表
export const addOrUpdateSCSGoodsCode = params => { return axios.post(`${baseUrl}/erp/addOrUpdateGyScsGoodsCode`, params) }
// 删除飞迩对照表
export const deleteSCSGoodsCode = params => { return axios.get(`${baseUrl}/erp/deleteGyScsGoodsCode?${params}`) }
// 置为有效飞迩对照表
export const usefulSCSGoodsCode = params => { return axios.get(`${baseUrl}/erp/usefulGyScsGoodsCode?${params}`) }
// 管易日志
export const getGYLogList = params => { return axios.get(`${baseUrl}/erp/getGyOrderLogList?${params}`) }

// 管易订单日志
export const getOrderListOfGy = params => { return axios.get(`${baseUrl}/erp/getOrderListOfGy?${params}`) }
// 管易重传+拦截
export const changeGYlogList = params => { return axios.get(`${baseUrl}/erp/updateHasDealManuallyOfGyOrder?${params}`) }

// 销帮帮商品对照列表
export const getXBBGoodsCodeList = params => { return axios.get(`${baseUrl}/crm/getXbbScsGoodsCodeList?${params}`) }
// 新增或编辑销帮帮商品对照表
export const addOrUpdateXBBGoodsCode = params => { return axios.post(`${baseUrl}/crm/addOrUpdateXbbScsGoodsCode`, params) }
// 删除销帮帮商品对照表
export const deleteXBBGoodsCode = params => { return axios.get(`${baseUrl}/crm/deleteXbbScsGoodsCode?${params}`) }
// 置为有效销帮帮商品对照表
export const usefulXBBGoodsCode = params => { return axios.get(`${baseUrl}/crm/usefulXbbScsGoodsCode?${params}`) }

// 销帮帮客户对照列表
export const getXBBCustomersCodeList = params => { return axios.get(`${baseUrl}/crm/getXbbScsCustomersCodeList?${params}`) }
// 新增或编辑销帮帮客户对照表
export const addOrUpdateXBBCustomersCode = params => { return axios.post(`${baseUrl}/crm/addOrUpdateXbbScsCustomersCode`, params) }
// 删除销帮帮客户对照表
export const deleteXBBCustomersCode = params => { return axios.get(`${baseUrl}/crm/deleteXbbScsCustomersCode?${params}`) }
// 置为有效销帮帮客户对照表
export const usefulXBBCustomersCode = params => { return axios.get(`${baseUrl}/crm/usefulXbbScsCustomersCode?${params}`) }

// 销帮帮单位对照列表
export const getXBBUnitsCodeList = params => { return axios.get(`${baseUrl}/crm/getXbbScsUnitsCodeList?${params}`) }
// 新增或编辑销帮帮单位对照表
export const addOrUpdateXBBUnitsCode = params => { return axios.post(`${baseUrl}/crm/addOrUpdateXbbScsUnitsCode`, params) }
// 删除销帮帮单位对照表
export const deleteXBBUnitsCode = params => { return axios.get(`${baseUrl}/crm/deleteXbbScsUnitsCode?${params}`) }
// 置为有效销帮帮单位对照表
export const usefulXBBUnitsCode = params => { return axios.get(`${baseUrl}/crm/usefulXbbScsUnitsCode?${params}`) }
// 手动退款
export const refund = params => { return axios.post(`${baseUrl}/erp/refund`,params) }
// 上传盛丰文件
export const uploadSFErpFile = params => { return axios.post(`${baseUrl}/erp/excel2goodsCodeSF`, params) }
// 盛丰对照列表
export const getSfGoodsCodeList = params => { return axios.get(`${baseUrl}/erp/getSfGoodsCodeList?${params}`) }
// 新增或编辑盛丰对照表
export const addOrUpdateSfGoodsCode = params => { return axios.post(`${baseUrl}/erp/addOrUpdateSfGoodsCode`, params) }
// 删除盛丰对照表
export const deleteSfGoodsCode = params => { return axios.get(`${baseUrl}/erp/deleteSfGoodsCode?${params}`) }
// 盛丰对照表置为有效
export const usefulGoodsCode = params => { return axios.get(`${baseUrl}/erp/usefulSfGoodsCode?${params}`) }
// 销帮帮商品同步
export const updateXBBGoods = params => { return axios.get(`${baseUrl}/crm/updateXBBIDinGoods`) }
// 销帮帮客户同步
export const updateXBBCustomer = params => { return axios.get(`${baseUrl}/crm/updateXBBIDinCustomer`) }
// 销帮帮日志
export const getXbbLogList = params => { return axios.get(`${baseUrl}/erp/getXbbLogList?${params}`) }
// 销帮帮日志重推
export const redealXbbLog = params => { return axios.get(`${baseUrl}/erp/redealXbbLogInfoManually?${params}`) }
// 分销商金蝶日志
export const getKdLogList = params => { return axios.get(`${baseUrl}/erp/getScsKdLogList?${params}`) }
// 分销商金蝶日志重推
export const redealKdLog = params => { return axios.get(`${baseUrl}/erp/redealScsKdLogInfoManually?${params}`) }


// 上传旺店通文件
// export const uploadWDTErpFile = params => { return axios.post(`${baseUrl}/erp/excel2goodsCodeSF`, params) }
export const uploadWDTErpFile = params => { return axios.post(`${baseUrl}/erp/excel2goodsCodeWDT`, params) }
// 旺店通对照列表
export const getWdtGoodsCodeList = params => { return axios.get(`${baseUrl}/erp/getWdtGoodsCodeList?${params}`) }
// 新增或编辑旺店通对照表
export const addOrUpdateWdtGoodsCode = params => { return axios.post(`${baseUrl}/erp/addOrUpdateWdtGoodsCode`, params) }
// 删除旺店通对照表
export const deleteWdtGoodsCode = params => { return axios.get(`${baseUrl}/erp/deleteWdtGoodsCode?${params}`) }
//旺店通对照表置为有效
export const usefulWdtGoodsCode = params => { return axios.get(`${baseUrl}/erp/usefulWdtGoodsCode?${params}`) }

// 飞迩仓库
export const getWarehouse = params => { return axios.get(`${baseUrl}/erp/getAllWarehouse`) }
// 飞迩仓库
export const updateWarehouse = params => { return axios.post(`${baseUrl}/erp/saveOrUpdateWarehouse`,params) }
// 代理列表
export const getAgentList = params => { return axios.get(`${baseUrl}/erp/allScsUser?${params}`) }
// 关联客户
export const bindAgent = params => { return axios.get(`${baseUrl}/erp/editScsUser?${params}`) }
// 转正式客户
export const transCus = params => { return axios.get(`${baseUrl}/erp/scsUserPass?${params}`) }
// 提现列表
export const tixianList = params => { return axios.get(`${baseUrl}/erp/allTixian?${params}`) }
// 打款
export const dakuan = params => { return axios.get(`${baseUrl}/erp/scsBatchTixian?${params}`) }
// 资金明细
export const getMoneyDetails = params => { return axios.get(`${baseUrl}/erp/allUserMoney?${params}`) }
// 批量驳回
export const onBatchBack = params => { return axios.get(`${baseUrl}/erp/scsBatchBack?${params}`) }